package com.yfuxdeer.youchat.utils;

import java.util.Date;

public class ConstellationUtil {
    public static String getConstellation(Date date) {
        int month = date.getMonth();
        int day = date.getDate();
        int[] firstDays = new int[]{20, 19, 21, 20, 21, 22, 23, 23, 23, 24, 23, 22};
        String[] cs = new String[]{"水瓶座", "双鱼座", "白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", "天蝎座", "射手座", "摩羯座"};
        if (day >= firstDays[month]) {
            return cs[month];
        } else {
            return cs[(month + 11) % 12];
        }
    }
}
